home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
math
/
nrpas13
/
chint.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-04-29
|
494b
|
20 lines
PROCEDURE chint(a,b: real; c: glcarray; VAR cint: glcarray; n: integer);
(* Programs using routine CHINT must define the type glcarray as in
routine CHEBFT. *)
VAR
j: integer;
sum,fac,con: real;
BEGIN
con := 0.25*(b-a);
sum := 0.0;
fac := 1.0;
FOR j := 2 TO n-1 DO BEGIN
cint[j] := con*(c[j-1]-c[j+1])/(j-1);
sum := sum+fac*cint[j];
fac := -fac
END;
cint[n] := con*c[n-1]/(n-1);
sum := sum+fac*cint[n];
cint[1] := 2.0*sum
END;